<?php
class Application_Form_Avatar extends Zend_Form
{
	public function __construct($options = null)
	{
		$this->setName('object');
		$this->setMethod("post");
		$this->setEnctype("multipart/form-data");
		
		$image = new Zend_Form_Element_File('image_file');
		$image->setLabel('Upload Image:');
		$image->setDestination(PUBLIC_PATH . '/img/profil/');
		$image->setRequired(true);
		$image->addValidator('Count', false, 1);
		$image->addValidator('Size', false, 1024000);
		$image->addValidator('Extension', false, 'jpg,jpeg,png');
		
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')
		->setLabel('save');
		
		
		
		$elements = array($image,$submit);
		$this->addElements($elements);
		$this->setDecorators( array( array('ViewScript', array('viewScript' => 'forms/avatar.phtml'))));
	}
}